package oleg.cfg;



/**
 * Copyright 2009 Oleg Frenkel
 *
 * This file is part of PerfectSearch.
 *
 * PerfectSearch is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PerfectSearch is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PerfectSearch.  If not, see <http://www.gnu.org/licenses/>.
 */

import oleg.C;
import oleg.rms.RMSManager;

public class Config
{
  static private Config instance = new Config();

  private RMSManager rmsMgr = RMSManager.instance();

  private int padMode;
  private String writingLang;
  private String interfaceLang;

  private Config() {
    padMode = C.PAD_MODE_PRED_ON;
    writingLang = rmsMgr.getString(C.RMS_WRITING_LANG, "en");
    interfaceLang = rmsMgr.getString(C.RMS_INTERFACE_LANG, "en");
  }

  static public Config instance() {
    return instance;
  }

  public int getPadMode() {
    return padMode;
  }

  public void setPadMode(int newPadMode) {
    this.padMode = newPadMode;
  }

  public String getWritingLang() {
    return writingLang;
  }

  public void setWritingLang(String newWritingLang) {
    this.writingLang = newWritingLang;
    rmsMgr.setString(C.RMS_WRITING_LANG, writingLang);
  }

  public String getInterfaceLang() {
    return interfaceLang;
  }

  public void setInterfaceLang(String newInterfaceLang) {
    this.interfaceLang = newInterfaceLang;
    rmsMgr.setString(C.RMS_INTERFACE_LANG, interfaceLang);
  }
}